package com.woniuxy.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniuxy.mapper.MemberMapper;
import com.woniuxy.pojo.Member;
import com.woniuxy.service.MemberService;
import com.woniuxy.util.MemberDate;

@Service
@Transactional
public class MemberServiceImp implements MemberService {

	@Resource
	private MemberMapper memberMapper;
	
	@Override
	public List<Member> findMember(String message) {
		return memberMapper.find("%"+message+"%");
	}
	
	@Override
	public List<Member> findByName(String name) {
		return memberMapper.findByName(name);
	}

	@Override
	public Member findByMember(Member member) {
		return memberMapper.findByMember(member);
	}

	@Override
	public Member findByMnumber(String mnumber) {
		return memberMapper.findByMnumber(mnumber);
	}

	@Override
	public List<Member> getAll() {
		return memberMapper.getAll();
	}

	@Override
	public int updateMember(Member member) {
		return memberMapper.updateMember(member);
	}

	@Override
	public int addMember(Member member) {
		member.setMnumber(MemberDate.getOrderCode());
		return memberMapper.addMember(member);
	}

	@Override
	public int delMember(String mnumber) {
		return memberMapper.delMember(mnumber);
	}

}
